#!/bin/bash

. `dirname $0`/../etc/controller.bash.inc
autoload_functions "db/sql/mysql/mresult_sql"

echo '[testing] mresult_sql()'
echo -n ' scenario 1 - '
RAW_province2capital='leyte tacloban cebu cebu bohol tagbilaran'
PROC_province2capital='leyte/tacloban cebu/cebu bohol/tagbilaran'
[[ "$(mresult_sql 2 $RAW_province2capital)" = "$PROC_province2capital" ]] && echo "OK" || echo "fail"
## TODO: Nice to have 3 or more columns to consolidate
#RAW_provCapReg='leyte tacloban 8 cebu cebu 7 bohol tagbilaran 7'
#PROC_provCapReg='leyte/tacloban/8 cebu/cebu/7 bohol/tagbilaran/7'
#[[ "$(mresult_sql 3 $RAW_provCapReg)" = "$PROC_provCapReg" ]] && echo "OK" || echo "fail"
